package cn.net.isir.service;

import cn.net.isir.core.BasicService;
import cn.net.isir.core.SetBasicDao;
import cn.net.isir.dao.PermissionDao;
import cn.net.isir.dao.RolePermissionDao;
import cn.net.isir.entity.Permission;
import cn.net.isir.entity.RolePermission;
import cn.net.isir.entity.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RolePermissionService extends BasicService<RolePermission> {
    @SetBasicDao
    @Resource
    private RolePermissionDao rolePermissionDao;
    @Resource
    private PermissionDao permissionDao;

    public List<Permission> selectPermissionListByUserId(String userId) {
        User user = new User();
        user.setId(userId);
        return permissionDao.selectPermissionListByUserId(user);
    }
}
